<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('record', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->unsigned()->nullable(false)->comment('用户id');
            $table->integer('activity_id')->unsigned()->nullable(false)->comment('活动id');
            $table->integer('award_item_id')->unsigned()->nullable(false)->comment('奖项id');
            $table->tinyInteger('is_win')->unsigned()->comment('是否中奖，0 未中奖 1 中奖');
            $table->tinyInteger('status')->unsigned()->comment('状态，1 未领取 2 已领取');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('record');
    }
};
